package com.xuelang.pipeline.artifact.client.resource;

import com.xuelang.pipeline.artifact.client.common.request.PageParam;
import com.xuelang.pipeline.artifact.client.common.result.ApiResult;
import com.xuelang.pipeline.artifact.client.common.result.PageRecord;
import com.xuelang.pipeline.artifact.client.resource.dto.ArtifactProxyDTO;
import com.xuelang.pipeline.artifact.client.resource.dto.ArtifactProxyQuery;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;
import java.util.List;

/**
 * 制品仓库代理服务API
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
public interface IArtifactProxyService {

    /**
     * 查询制品仓库代理列表(有过滤条件，可以分页)
     *
     * @param dtoPageParam 查询条件
     * @return
     */
    @PostMapping(value = "/pageList", produces = "application/json;charset=utf-8")
    ApiResult<PageRecord<ArtifactProxyDTO>> pageArtifactProxyList(@RequestBody @Valid PageParam<ArtifactProxyQuery> dtoPageParam);

    /**
     * 查询制品仓库代理列表(有过滤条件)
     *
     * @param artifactProxyQuery 查询条件
     * @return
     */
    @PostMapping(value = "/list", produces = "application/json;charset=utf-8")
    ApiResult<List<ArtifactProxyDTO>> conditionalArtifactProxyList(@RequestBody @Valid ArtifactProxyQuery artifactProxyQuery);

    /**
     * 新增制品仓库代理
     *
     * @param artifactProxyDTO 制品仓库代理DTO
     * @return
     */
    @PostMapping(value = "", produces = "application/json;charset=utf-8")
    ApiResult<Boolean> addArtifactProxy(@RequestBody @Valid ArtifactProxyDTO artifactProxyDTO);

    /**
     * 更新制品仓库代理
     *
     * @param artifactProxyDTO 制品仓库代理DTO
     * @return
     */
    @PutMapping(value = "", produces = "application/json;charset=utf-8")
    ApiResult<Boolean> updateArtifactProxy(@RequestBody @Valid ArtifactProxyDTO artifactProxyDTO);

    /**
     * 删除制品仓库代理
     *
     * @param artifactProxyUuid 制品仓库代理UUID
     * @return
     */
    @DeleteMapping(value = "/{artifactProxyUuid}", produces = "application/json;charset=utf-8")
    ApiResult<Boolean> deleteArtifactProxy(@PathVariable("artifactProxyUuid") String artifactProxyUuid);
    /**
     * 查询制品仓库代理
     *
     * @param artifactProxyUuid 制品仓库代理UUID
     * @return
     */
    @GetMapping(value = "/{artifactProxyUuid}", produces = "application/json;charset=utf-8")
    ApiResult<ArtifactProxyDTO> queryArtifactProxy(@PathVariable("artifactProxyUuid") String artifactProxyUuid);

    
}
